const path =  require("path")

module.exports = {
    // ts编译配置
    entry : "./src/index.ts",
    output:{
        path:path.resolve(__dirname,"dist"),
        filename:"./index.js"
    },
    module:{
        rules:[
            {
                test:/\.ts$/,
                use:["ts-loader"]
            }
        ]
    },
    mode:"development",
    resolve: {
        extensions: [ ".ts", ".js" ] // 添加ts和js作为可解析的扩展
    },
    
    // html运行配置
    devServer:{
        static:"./dist",
        open:true,
        hot:true
    }
}